/*
 * File:   RandomDiscardStrategy.h
 * Author: root
 *
 * Created on November 18, 2008, 1:54 PM
 */

#include "DiscardStrategy.h"

#ifndef _RANDOMDISCARDSTRATEGY_H
#define	_RANDOMDISCARDSTRATEGY_H

class RandomDiscardStrategy : public DiscardStrategy {

    int lastHandSize;

protected:
    virtual void setExecutionParameter(int index, int rangeFraction) {}

public:
    
    RandomDiscardStrategy() : DiscardStrategy(string("RandomDiscardStrategy"), 0), lastHandSize(4) {}
    
    RandomDiscardStrategy(int myWeight)
    : DiscardStrategy(myWeight),
      lastHandSize(4)
    {
//         lastHandSize = 4;
    }
                
    virtual int getDecisionCertainty() {
        return 100 / lastHandSize;  // The agent has a one in four or three (depending on the hand size) chance of picking the theoretical best card (is this sound?)
    }

    virtual Strategy* getActiveInstance(int inst_weight) {
        return dynamic_cast<Strategy*>(new RandomDiscardStrategy(inst_weight));
    }
    
    virtual void opponentMove(int opponent, const Move& move) {}
    virtual int pickDiscard(CCardStack*, bool, const GameState*);

};

#endif	/* _RANDOMDISCARDSTRATEGY_H */

